package com.yanqu.road.server.cmd.wingroom;

import com.yanqu.road.pb.wingroom.WingRoomProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.wingroom.WingRoomModule;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.GameProtocol;
import com.yanqu.road.server.protocol.Protocol;

/**
 * @author ：zfr
 * @date ：2022/2/8 15:15
 */
//@Cmd(code = GameProtocol.S_WING_ROOM_UNLOCK_FURNITURE_SAMPLE, desc = "解锁家具图鉴")
public class UnlockFurnitureSampleCmd extends AbstractCommand {
    private int furnitureId;
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        WingRoomProto.UnlockFurnitureSampleReqMsg reqMsg = WingRoomProto.UnlockFurnitureSampleReqMsg.parseFrom(packet.getBytes());
        furnitureId = reqMsg.getFurnitureId();
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
//        ret = player.getModule(WingRoomModule.class).unlockFurnitureSample(furnitureId);
    }

    @Override
    public void sendData(GamePlayer player) {
        WingRoomProto.UnlockFurnitureSampleRespMsg.Builder respMsg = WingRoomProto.UnlockFurnitureSampleRespMsg.newBuilder();
        respMsg.setRet(ret);
        player.sendPacket(Protocol.U_WING_ROOM_UNLOCK_FURNITURE_SAMPLE, respMsg);
    }
}
